﻿#region GNU GPL Version 3 License

/// Copyright 2013 Shailesh Lolam
/// 
/// This file HostedServices.cs is part of AzEzAuto.
/// 
/// AzEzAuto is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
/// 
/// AzEzAuto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
/// 
/// You should have received a copy of the GNU General Public License along with AzEzAuto. If not, see http://www.gnu.org/licenses/.
/// 
/// History:
/// ______________________________________________________________
/// Created         04-2013             Shailesh Lolam

#endregion
      
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace AzEzAuto.Entities.Hosted
{
    [XmlRoot("HostedServices", Namespace = "http://schemas.microsoft.com/windowsazure")]
    public class HostedServices
    {
        private List<HostedService> _services = new List<HostedService>();
        
        [XmlElement(Type = typeof(HostedService), ElementName = "HostedService")]
        public List<HostedService> Services { get { return _services; } }
    }

    [XmlRoot("HostedService",Namespace="http://schemas.microsoft.com/windowsazure")]
    public class HostedService
    {
        public string Url;
        public string ServiceName;
        [XmlElement(Type=typeof(HostedServiceProperties),ElementName="HostedServiceProperties")]
        public HostedServiceProperties Properties;

        private List<Deployment> _deployments = new List<Deployment>();

        public List<Deployment> Deployments { get { return _deployments; } }
    }

    
    public class HostedServiceProperties
    {
        public string Description; 
        public string AffinityGroup;
        public string Location;
        public string Label;
        public string Status;
        public DateTime DateCreated;
        public DateTime DateLastModified;

        private List<ExtendedProperty> _extendedProperties = new List<ExtendedProperty>();
        [XmlArray(ElementName = "ExtendedProperties")]
        [XmlArrayItem(Type = typeof(ExtendedProperty), ElementName="ExtendedProperty")]
        public List<ExtendedProperty> ExtendedProperties { get { return _extendedProperties; } }
    }
}
